import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";

// https://vitejs.dev/config/
export default defineConfig({
	plugins: [react()],
	resolve: {
		alias: {
			"@": "/src" // 将 @ 指向 src 目录
		}
	},

	css: {
		preprocessorOptions: {
			scss: {
				api: "modern-compiler",
				additionalData: `@use "@/style/global.scss";`
			}
		}
	},
	server: {
		port: 3000,
		proxy: {
			"/api/": {
				target: "http://localhost:8000",
				changeOrigin: true
			}
		}
	}
});
